home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Communications Toolbox / CommToolbox 1.1 / Interfaces / PInterfaces / CommResources.p next >
Encoding:
Text File  |  1994-11-21  |  3.4 KB  |  109 lines  |  [TEXT/MPS ]

  1. {************************************************************
  2.  CommResources.p
  3.  Pascal Interface to the Macintosh Libraries
  4.  
  5.           Copyright Apple Computer, Inc. 1988-1991
  6.         All rights reserved
  7. ************************************************************}
  8.  
  9.  
  10. {$IFC UNDEFINED UsingIncludes}
  11. {$SETC UsingIncludes := 0}
  12. {$ENDC}
  13.  
  14. {$IFC NOT UsingIncludes}
  15.     UNIT CommResources;
  16.     INTERFACE
  17. {$ENDC}
  18.  
  19. {$IFC UNDEFINED UsingCommResources}
  20. {$SETC UsingCommResources := 1}
  21.  
  22. {$I+}
  23. {$SETC CommResourcesIncludes := UsingIncludes}
  24. {$SETC UsingIncludes := 1}
  25. {$IFC UNDEFINED UsingOSUtils}
  26. {$I $$Shell(PInterfaces)OSUtils.p}
  27. {$ENDC}
  28. {$SETC UsingIncludes := CommResourcesIncludes}
  29.  
  30. CONST
  31.  
  32. {    version of the Comm Resource Manager    }
  33. curCRMVersion     =     2;
  34.  
  35. {    tool classes (also the tool file types)    }
  36. classCM         =    'cbnd';
  37. classFT         =    'fbnd';
  38. classTM            =    'tbnd';
  39.  
  40. {    constants general to the use of the Communications Resource Manager }
  41. crmType         =     9;                { queue type }
  42. crmRecVersion    =     1;                { version of queue structure }
  43.  
  44. {    error codes }
  45. crmGenericError    =    -1;
  46. crmNoErr        =    0;
  47.  
  48. TYPE
  49. {    data structures general to the use of the Communications Resource Manager }
  50. CRMErr            =    OSErr;
  51.  
  52. CRMRecPtr         = ^CRMRec;
  53. CRMRec             = RECORD
  54.     qLink:             QElemPtr;      {reserved}
  55.     qType:             INTEGER;      {queue type -- ORD(crmType) = 9}
  56.     crmVersion:     INTEGER;    {version of queue element data structure}
  57.     crmPrivate:     LONGINT;    {reserved}
  58.     crmReserved:     INTEGER;       {reserved}
  59.     crmDeviceType:     LONGINT;    {type of device, assigned by DTS}
  60.     crmDeviceID:     LONGINT;    {device ID; assigned when CRMInstall is called}
  61.     crmAttributes:     LONGINT;    {pointer to attribute block}
  62.     crmStatus:         LONGINT;    {status variable - device specific}
  63.     crmRefCon:         LONGINT;    {for device private use}
  64.     END;
  65.  
  66.  
  67. FUNCTION     InitCRM: CRMErr;
  68. FUNCTION     CRMGetHeader: QHdrPtr;
  69. PROCEDURE     CRMInstall(crmReqPtr: QElemPtr);
  70. FUNCTION     CRMRemove(crmReqPtr: QElemPtr): OSErr;
  71. FUNCTION     CRMSearch(crmReqPtr: QElemPtr): QElemPtr;    
  72. FUNCTION     CRMGetCRMVersion: INTEGER;
  73.  
  74. FUNCTION     CRMGetResource(theType: ResType;theID: INTEGER): Handle;
  75. FUNCTION     CRMGet1Resource(theType: ResType;theID: INTEGER): Handle;
  76. FUNCTION     CRMGetIndResource(theType: ResType;index: INTEGER): Handle;
  77. FUNCTION     CRMGet1IndResource(theType: ResType;index: INTEGER): Handle;
  78. FUNCTION     CRMGetNamedResource(theType: ResType;name: Str255): Handle;
  79. FUNCTION     CRMGet1NamedResource(theType: ResType;name: Str255): Handle;
  80. PROCEDURE     CRMReleaseResource(theHandle: Handle);
  81. FUNCTION     CRMGetToolResource(procID: INTEGER;theType: ResType;theID: INTEGER): Handle;
  82. FUNCTION     CRMGetToolNamedResource(procID: INTEGER;theType: ResType;name: Str255): Handle;
  83. PROCEDURE     CRMReleaseToolResource(procID: INTEGER;theHandle: Handle);
  84. FUNCTION     CRMGetIndex(theHandle: Handle): LONGINT;
  85.  
  86. FUNCTION     CRMLocalToRealID(bundleType: ResType;toolID: INTEGER;theType: ResType;
  87.                      localID: INTEGER): INTEGER;
  88. FUNCTION     CRMRealToLocalID(bundleType: ResType;toolID: INTEGER;theType: ResType;
  89.                      realID: INTEGER): INTEGER;
  90.                     
  91. FUNCTION    CRMGetIndToolName(bundleType: OSType;index: INTEGER;VAR toolName: Str255): OSErr;
  92.  
  93. FUNCTION    CRMFindCommunications(VAR vRefNum: INTEGER;VAR dirID: LONGINT): OSErr;
  94.  
  95. FUNCTION    CRMIsDriverOpen(driverName: Str255): BOOLEAN;
  96.  
  97. FUNCTION    CRMParseCAPSResource(theHandle: Handle;selector: ResType;VAR value: LONGINT): CRMErr;
  98.  
  99. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  100. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  101.  
  102.  
  103. {$ENDC} { UsingCommResources }
  104.  
  105. {$IFC NOT UsingIncludes}
  106.     END.
  107. {$ENDC}
  108.  
  109.